<template>
  <div>
    <h1>{{totalPrice}}</h1>
  </div>
</template>

<script>
// totalPrice
/**
 * 1. 获取类
 *   mapGetters, mapState,
 *  computed: {
 *   ...mapGetters(['']),
 *   ...mapState([''])
 * }
 * 2. 设置类
 * mapMutations, mapActions
 *
 * methods: {
 *     ...mapMutations([])
 *     ...mapActions([])
 *  }
 *
 *
 * */

import { mapGetters, mapState, mapMutations, mapActions } from "vuex";
export default {
  computed: {
    ...mapGetters("cart", ["totalPrice"]),
  },
};
</script>

<style>
</style>